﻿using Abp.Application.Services.Dto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace shenghua.Commodity.Commodities.Dto
{
    public class CreateShoppingOptionDto
    {
        public int CommodityId { get; set; }
        public double Price { get; set; }
        public int XPValue { get; set; }
        public int Inventory { get; set; }
        public int MinLimitCount { get; set; }
        public int MaxLimitCount { get; set; }
        public string Picture { get; set; }
        public List<string> Pictures { get; set; }
        public Dictionary<string, string> ShoppingOptionParameters { get; set; }

        public CreateShoppingOptionDto()
        {
            Pictures = new List<string>();
            ShoppingOptionParameters = new Dictionary<string, string>();
        }

        public void MapTo(CommodityShoppingOption commodityShoppingOption)
        {
            commodityShoppingOption.CommodityId = CommodityId;
            commodityShoppingOption.Price = Price;
            commodityShoppingOption.XPValue = XPValue;
            commodityShoppingOption.Inventory = Inventory;
            commodityShoppingOption.MinLimitCount = MinLimitCount;
            commodityShoppingOption.MaxLimitCount = MaxLimitCount;
            commodityShoppingOption.Pictures = new Common.CustomValueType.ValueArray<string>(Pictures);
            commodityShoppingOption.SetShoppingOptionParameters(ShoppingOptionParameters);
        }
    }
}
